Skip to content

feat(ContractEventFeed): announce Export JSON count to screen readers, document fromLedger (#341) - #387

Merged
k-deejah merged 1 commit into
Sorokit:mainfrom
oladev2026-tech:wave-issue-341-eventfeed-features
Jul 29, 2026
Merged

feat(ContractEventFeed): announce Export JSON count to screen readers, document fromLedger (#341)#387
k-deejah merged 1 commit into
Sorokit:mainfrom
oladev2026-tech:wave-issue-341-eventfeed-features

Conversation

@oladev2026-tech

Copy link
Copy Markdown
Contributor

Summary

Issue #341 lists three gaps (JSON export, topic copy, fromLedger prop) that are already implemented in src/components/ContractEventFeed.tsx and covered by the existing #352 test suite (describe("JSON export (#352)", "topic copy (#352)", "fromLedger prop (#352)").

This commit layers two refinements on top:

  1. Export JSON aria-label: the trigger button now reads "Export N events as JSON" for screen readers, where N is the current event count. The visual button label stays Export JSON. The hover title is unchanged. This makes the button content self-describing without introducing a UX regression.
  2. fromLedger JSDoc: the prop now has documentation describing the two modes (omitted = latest from network, set = page historical events from a chosen ledger). The previous type-only hint left consumers without context for when to use which mode.

Notes

  • No existing test was modified; the existing describe("JSON export (#352)"), describe("topic copy (#352)"), and describe("fromLedger prop (#352)") blocks already exercise the three features called out in the issue title.
  • The keyboard-only flow (Tab → Enter on the Export JSON button) is unchanged.
  • No state, no new dependencies, no new exports.

Closes #341

…readers, document fromLedger (Sorokit#341)

Issue Sorokit#341 lists three gaps that are already implemented in source and covered by the existing Sorokit#352 test suite (JSON export Sorokit#352, topic copy Sorokit#352, fromLedger Sorokit#352):

- `JSON.stringify(events, null, 2)` is already wired to an Export JSON button in the header.
- Each `TopicTag` already has a hover-reveal copy button that calls `navigator.clipboard.writeText(topic)`.
- `fromLedger?: number` is already plumbed through to `getClient().soroban.getEvents(contractId, limit, fromLedger)`.

This commit makes two small refinements on top:

1. The Export JSON button now exposes an `aria-label` that announces the exact number of events about to be downloaded (`Export 3 events as JSON`). Screen readers were otherwise reading the tooltip-only `title=\"Export JSON\"` which is content-bearing but not role-compliant. The same button text on the surface stays `Export JSON` so the visual UI does not regress.

2. The `fromLedger` prop on `ContractEventFeedProps` now has a proper JSDoc explaining the two modes: omitted (\"latest from the network\") vs set (\"page historical events starting at this ledger\"), which was previously documented only by the type system.

No tests updated / no tests removed. The existing Sorokit#352 test suite already verifies the three flags in Sorokit#341\u2019s title.

Closes Sorokit#341
@k-deejah
k-deejah merged commit 4170d42 into Sorokit:main Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ContractEventFeed): no JSON export button, topic tags not copyable, no fromLedger prop for historical queries

2 participants